"
"	~/.gvimrc or /etc/gvimrc
"

" set chinese menu
set encoding=utf8
set langmenu=zh_CN.UTF-8
set imcmdline
source $VIMRUNTIME/delmenu.vim
source $VIMRUNTIME/menu.vim

" colorscheme set the color scheme on gvim
" I like deep color backgroud and light color foreground, here there are
" elflord koehler murphy pablo ron slate torte
colorscheme elflord

" set font
set guifont=Bitstream\ Vera\ Sans\ Mono\ 14
set guifontwide=WenQuanYi\ Bitmap\ Song\ 12

" set line number, 1-9999 
set number
set numberwidth=4

" set line space
set linespace=2

" auto highlight syntax
syntax on

" set code auto-indent
set autoindent

" hide the mouse when typing text
set mousehide

" set command line height, use line as height unit
set cmdheight=2

" highlighting strings inside C comments
let c_comment_strings=1

" highlighting search string
set hlsearch

" set ctags support
set tags=tags;
  set autochdir

" set Taglist support
let Tlist_Auto_Open=1
let Tlist_Auto_Update=1
let Tlist_Show_One_File=1
let Tlist_Sort_Type="name"
let Tlist_Exit_OnlyWindow=1
let Tlist_Use_Right_Window=1
let Tlist_Show_Menu=1
let Tlist_Ctags_Cmd = '/usr/bin/ctags'
let Tlist_Hightlight_Tag_On_BufEnter=1
let Tlist_File_Fold_Auto_Close = 0
let Tlist_Process_File_Always = 1
let Tlist_Display_Prototype = 0
let Tlist_Compact_Format = 1
map <F4> :TlistToggle <CR>


" Uncomment the following to have Vim jump to the last position when
" reopening a file
if has("autocmd")
	au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$")
	\| exe "normal g'\"" | endif
endif

" Uncomment the following to have Vim load indentation rules according to the
" detected filetype. Per default Debian Vim only load filetype specific
" plugins.
if has("autocmd")
	filetype indent on
endif

" Add C language templator when create a new *.c file or *.h file
autocmd BufNewFile main.c 0r ~/fzgit/code/templator/main.c
autocmd BufNewFile m.c,[^m]*.c,ma.c,m[^a]*.c,mai.c,ma[^i]*.c,mai[^n]*.c,main?*.c 0r ~/fzgit/code/templator/templator.c
autocmd BufNewFile *.h 0r ~/fzgit/code/templator/templator.h
autocmd BufNewFile *_test.c 0r ~/fzgit/code/templator/main.c
autocmd BufNewFile Makefile 0r ~/fzgit/code/templator/Makefile

" expand "//" to "/* */" in C language and expand "/**" to "/**<cr>*<cr>*/" mode
au BufNewFile,BufRead *.[ch] iabbrev // /*!cursor! */<esc>:call search('!cursor!', 'b')<cr>cf!
au BufNewFile,BufRead *.[ch] iabbrev /** /**<cr><tab>!cursor! <cr>/<esc>:call search ('!cursor!', 'b')<cr>cf!

" set status bar at buttom.
set laststatus=2
set statusline=%F\ [TYPE=%Y]\ [ASCII:HEX=\%03.3b:%02.2B]\ [POS=%04l,%04v][%p%%]\ [LINES=%L]



